package cn.com.api.mapper;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import cn.com.api.entity.ApiDianPing;
import cn.com.api.resultpage.DianpingPage;
import cn.com.util.*;

public interface ApiDianPingMapper {
	public ApiDianPing searchDianPingByCid(@Param("c_id") int c_id);

	public List<ApiDianPing> searchDianPingBySid(@Param("c_sid") int c_sid);

	public List<ApiDianPing> searchDianPingByGoodsid(@Param("c_goodsid") Long c_goodsid);

	public Map<String, Object> searchDianPingCountRateByGoodsid(@Param("c_goodsid") Long c_goodsid);

	public List<ApiDianPing> searchDianPingByOrderid(@Param("c_orderid") String c_orderid);

	public void updateDianPing(ApiDianPing apiDianPing);

	public void replyDianPing(ApiDianPing apiDianPing);

	public void addDianPing(ApiDianPing apiDianPing);

	/** 评价列表 type=0 全部 1-满意 2-不满意 */
	public List<DianpingPage> searchDianPingByGoodsidAndGradeListPage(@Param("map") Map<String, Object> map,
			@Param("page") PageInfo page);

	/** 用户评价 评分 数量 */
	public Map<String, Object> searchDianPingSumInfoByGoodsid(@Param("map") Map<String, Object> map);

	/** 商铺端 */
	/** 用户评价 评分 数量 */
	public List<Map<String, Object>> searchDianPingSumInfoByShopid(@Param("map") Map<String, Object> map);

	/** 评价列表 type=0 全部 1-未回复的差评 2-未回复 */
	public List<DianpingPage> searchDianPingByShopidAndGradeListPage(@Param("map") Map<String, Object> map,
			@Param("page") PageInfo page);

	public Integer getDianPingSize(HashMap map);

	public Integer getAllDianPingSize(@Param("map") HashMap map);

	public List<DianpingPage> searchAllDianPingByShopidAndGradeListPage(@Param("map") Map<String, Object> map,
			@Param("page") PageInfo page);

	public ApiDianPing getDianPingByCondition(@Param(value = "orderNum") String orderNum,
			@Param(value = "productId") String productId);

	public List<Map<String, Object>> getGoodDianPingListPage(@Param(value = "goodId") int goodId,
			@Param("page") PageInfo pageInfo);

	public Map<String, Object> getDianPingPointByUserId(String userId);

	public String getCountDianPingByUserId(String userId);

	public void batchInsert(List<ApiDianPing> list);

	public List<Map<String, Object>> selectOrderDianPingListPage(@Param("map") Map<String, Object> conditions,
			@Param("page") PageInfo pageInfo);

	public void logicDelDianPing(String dpId);
}
